﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CXedu.Model;
using CXedu.Business;
using System.Collections;
using Ajeelee.Core.Utils;

namespace CXedu.WebSite
{
    public partial class adultedu : System.Web.UI.Page
    {
        Hashtable table = new Hashtable();
        //焦点图片
        protected IList<PhotoImgs> photoImgsList = new List<PhotoImgs>();

        //远程教育
        protected IList<News> ycyjNewsList = new List<News>();
        //自学考试
        protected IList<News> zxksNewsList = new List<News>();
        //在职研究生
        protected IList<News> zzyjsNewsList = new List<News>();
        //成人高考
        protected IList<News> crgkNewsList = new List<News>();

        INewsBusiness newsBll = new NewsBusinessFactory().CreateNewsBusiness();
        IPhotoImgsBusiness photoBll = new PhotoImgsBusinessFactory().CreatePhotoImgsBusiness();

        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                //焦点图片
                table.Clear();
                table.Add("TopNum", 5);
                table.Add(PhotoImgsHash.CId, 3);
                table.Add(PhotoImgsHash.OrderField, "Sort");
                table.Add(PhotoImgsHash.OrderDirection, "asc");
                photoImgsList = photoBll.GetAllPhotoImgs(table);

                //远程教育
                table.Clear();
                table.Add("TopNum", 9);
                table.Add(NewsHash.CId, 2);
                table.Add(NewsHash.OrderField, "Top");
                table.Add(NewsHash.OrderDirection, "desc,N_Id desc");
                ycyjNewsList = newsBll.GetAllNews(table);

                //自学考试
                table.Clear();
                table.Add("TopNum", 9);
                table.Add(NewsHash.CId, 3);
                table.Add(NewsHash.OrderField, "Top");
                table.Add(NewsHash.OrderDirection, "desc,N_Id desc");
                zxksNewsList = newsBll.GetAllNews(table);

                //在职研究生
                table.Clear();
                table.Add("TopNum", 9);
                table.Add(NewsHash.CId, 4);
                table.Add(NewsHash.OrderField, "Top");
                table.Add(NewsHash.OrderDirection, "desc,N_Id desc");
                zzyjsNewsList = newsBll.GetAllNews(table);

                //成人高考
                table.Clear();
                table.Add("TopNum", 9);
                table.Add(NewsHash.CId, 5);
                table.Add(NewsHash.OrderField, "Top");
                table.Add(NewsHash.OrderDirection, "desc,N_Id desc");
                crgkNewsList = newsBll.GetAllNews(table);
            }
            catch (Exception ex)
            {
                Function.WriteErrorLog(ex);
            }
        }
    }
}